<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name=viewport
			content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,minimal-ui">
		<meta name="referrer" content="no-referrer">
		<title>播放器</title>
		<style type="text/css">
			html,
			body {
				width: 100%;
				height: 100%;
				margin: 0;
				padding: 0;
				overflow: hidden;
			}

			body {
				display: flex;
			}

			#mse {
				flex: auto;
			}

			.xgplayer-controls {
				bottom: 35px !important;
			}
		</style>
		<link rel="stylesheet" href="./css/index.min.css">
	</head>
	<body>
		<div id="mse"></div>
		<script src="./js/index.min.js" charset="utf-8"></script>
		<script src="./js/hls.min.js" charset="utf-8"></script>
		<script src="./css/uni.js"></script>

		<script type="text/javascript">
			let params = new URLSearchParams(location.search);

			let player = new window.Player({
				id: 'mse',
				url: params.get('url'),
				poster: params.get('poster'),
				title: params.get('title'),
				autoplay:true,
				rotate: true,
				playsinline: true,
				cssfullscreen: true,
				fullscreen: {
					useCssFullscreen: true // 全屏按钮将会调用页面内全屏
				},
				fitVideoSize: 'fixHeight',
				height: window.innerHeight,
				width: window.innerWidth,
				plugins: [window.HlsPlayer]
			});

			const Events = window.Player.Events
			player.on(Events.FULLSCREEN_CHANGE, (isFullscreen) => {
				uni.postMessage({
					data: {
						isFullscreen: isFullscreen ? '1' : '0'
					}
				});
			})
		</script>
	</body>
</html>